<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
        <title>库房</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="../css/font.css">
    <link rel="stylesheet" href="../css/xadmin.css">
    <link rel="stylesheet" href="../lib/layui/css/layui.css">
    <script src="../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../js/xadmin.js"></script>
    <script src="../lib/axios.min.js"></script>
    <script src="../lib/FileSaver.min.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row">
        <br/><br/>
        <form class="layui-form" id="mainForm">
            <div class="layui-form-item">
                <label for="new" class="layui-form-label">
                    可选项
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="new" name="new"
                    autocomplete="off" class="layui-input">
                </div>
                <button type="button" class="layui-btn" lay-filter="inc" lay-submit="">
                    新增
                </button>
        
            </div>
            <div class="layui-form-item">
              <label for="field" class="layui-form-label">
                  分类
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="field" name="field"
                  autocomplete="off" class="layui-input">
              </div>
              <button type="button" class="layui-btn layui-btn-normal" lay-filter="save" lay-submit="">
                保存
              </button>
              <button type="button" class="layui-btn layui-btn-danger" lay-filter="del" lay-submit="">
                  删除
              </button>
              <button class="layui-btn layui-btn-warm" type="button" onclick="backup();">
                  <i class="icon iconfont">&#xe714;</i>
              </button>
              &nbsp;&nbsp;&nbsp;
              <div style="position: relative; display: inline;">
                  <input id="upload-input" style="position: absolute; top: 0; bottom: 0; left: 0;right: 0; opacity: 0; display: inline;" type="file" accept="application/json" onchange="recovery(this)" />
                  <!-- 自定义按钮效果 -->
                  <div style="text-align: top; display: inline;">
                      <i class="layui iconfont">&#xe71d;</i>
                  </div>
              </div>
            </div>
            <br/>
            <div class="layui-form-item">
                <label for="field" class="layui-form-label">
                    值
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="field" name="field"
                    autocomplete="off" class="layui-input">
                </div>
                <label for="text" class="layui-form-label">
                    标题
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="title" name="title"
                    autocomplete="off" class="layui-input">
                </div>
                <button  class="layui-btn" lay-filter="add" lay-submit="">
                    添加
                </button>
            </div>
        </form>
    </div>
    <div class="layui-row">
    <table id="demo" lay-filter="test" style="margin: 0 auto;"></table></div>
  </div>
  <script>
    layui.use(['form','table'], function(){
      var form = layui.form
      ,table = layui.table;

      table.render({
        elem:'#demo'
        ,width: 400
        ,cols: [[
          {field: 'value', title: '值'}
          ,{field: 'title', title: '标题'}
        ]]
        ,data: []
      })
    })
  </script>
</body>
</html>